<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app"></div>
    <template id="t1">
      <div>
        <!-- 
          v-for 循环创建dom节点
          v 局部变量，保存每次遍历的属性值，只能在标签内部使用
          k 局部变量，保存每次遍历的属性名，只能在标签内部使用
         -->
        <ul>
          <li v-for=" (v,k,i) in user" :key="k">{{i}}-{{k}}:{{v}}</li>
        </ul>
      </div>
    </template>
    <script src="./vue.js"></script>
    <script>
      const vm = new Vue({
        el: "#app",
        template: "#t1",
        data: {
          user: {
            name: "jack",
            age: 20,
            gender: "boy",
          },
        },
      });
    </script>
  </body>
</html>
